// src/utils/permission.ts

// 按钮权限验证
export function hasPermission(key: string): boolean {
    const permissions = JSON.parse(localStorage.getItem('permission') || '[]')
    return permissions.includes(key)
}
export default {
    mounted(el:any, binding:any) {
      if (!hasPermission(binding.value)) {
        el.parentNode && el.parentNode.removeChild(el)
      }
    }
  }